package com.changgou.search.listener;

import com.changgou.search.config.RabbitMQConfig;
import com.changgou.search.service.ESManagerService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class GoodsDownListener {

	@Autowired
	ESManagerService esManagerService;

	//定义MQ监听类，监听商品下架队列
	@RabbitListener(queues = RabbitMQConfig.SEARCH_DEL_QUEUE)
	public void receiveMessage(String spuId){
		//调用业务层，完成ES中的删除SkuInfo的操作
		esManagerService.delDataBySpuId(spuId);
	}
}
